import axios from '../utils/axios'
import baseUrl from './baseUrl'

let getIndexData=()=>{
    let url = baseUrl+'/index/'
    return axios.get(url)
}

let getIndexPersonData=()=>{
    let url = baseUrl+'/index_people/'
    return axios.get(url)
}

let getIndexAlarmData=()=>{
    let url = baseUrl+'/index_alarm/'
    return axios.get(url)
}

let getIndexRankData=()=>{
    let url = baseUrl+'/index_evaluate/'
    return axios.get(url)
}

let getFacilityStatement=()=>{
    let url = baseUrl+'/facility_statement/'
    return axios.get(url)
}

let getFacilityData=(page,page_size)=>{
    let url = baseUrl+'/facility/'
    return axios.get(url,{page,page_size})
}

let searchAccount=(number,name,page,page_size)=>{
    let url = baseUrl+'/filter_facility/'
    return axios.get(url,{number,name,page,page_size})
}

let createNewAccount=(data)=>{
    let url = baseUrl+'/other_facility/'
    return axios.post(url,{data})
}

let getToiEquipData=(page,page_size)=>{
    let url = baseUrl+'/toilets/'
    return axios.get(url,{page,page_size})
}

let searchEquipData=(name1,name2,page,page_size)=>{
    let url = baseUrl+'/filter_toilet/'
    return axios.get(url,{name1,name2,page,page_size})
}

let getEquipMonitorData=(page,page_size)=>{
    let url = baseUrl+'/toilet_data/'
    return axios.get(url,{page,page_size})
}

let getEquipAlarmData=(page,page_size)=>{
    let url = baseUrl+'/alarms/'
    return axios.get(url,{page,page_size})
}

let searchAlarmData=(name1,name2,page,page_size)=>{
    let url = baseUrl+'/filter_alarms/'
    return axios.get(url,{name1,name2,page,page_size})
}

let getToiInfoData=()=>{
    let url = baseUrl+'/facility_info/'
    return axios.get(url)
}

let getToiletDetailData=(number)=>{
    let url = baseUrl+'/facility_detail/'
    return axios.get(url,{number})
}

let searchMonitorData=(name1,name2,page,page_size)=>{
    let url = baseUrl+'/filter_toilet_data/'
    return axios.get(url,{name1,name2,page,page_size})
}

let getReportData=(page,page_size)=>{
    let url = baseUrl+'/incidents/'
    return axios.get(url,{page,page_size})
}

export {
    getIndexData,
    getIndexPersonData,
    getIndexAlarmData,
    getIndexRankData,
    getFacilityStatement,
    getFacilityData,
    searchAccount,
    createNewAccount,
    getToiEquipData,
    searchEquipData,
    getEquipMonitorData,
    getEquipAlarmData,
    searchAlarmData,
    getToiInfoData,
    getToiletDetailData,
    searchMonitorData,
    getReportData
}